let uid = location.href.split('?')[1].split('=')[1]
console.log(uid);
let roletypename = document.querySelector('.roletypename'),
    description = document.querySelector('.description')

const get_one_roletype = async() => {
    let response = await ajax(`get_one_roletype?id=${uid}`)
    let roletype = response.data[0]
    roletypename.value = roletype.roletypename
    description.value = roletype.description
}

const update_copyright = () => {
    let roletypename1 = roletypename.value,
        description1 = description.value
    let obj = {
        id: uid,
        roletypename: roletypename1,
        description: description1
    }
    const response = ajax('updateroletype', 'PUT', obj)
    alert('修改成功!')
    location.href = './roletype.html'
}
window.onload = function() {
    get_one_roletype()
}